//
//  DatabaseUtils.h
//  IWeighMyself
//
//  Created by Francisco Gindre on 8/24/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Weight.h"

@interface DatabaseUtils : NSObject {
	
}

/*
 loads all queries from a table and specified database
 */

+(NSMutableArray*)queryAllEntriesFromDatabase:(NSString*)aDBPath fromTable:(NSString*)aTableName;

/*
 loads all queries from a a table between the specified dates
 */

+(NSMutableArray*)queryAllEntriesFromDatabaseBetweenDates:(NSString*)aDBPath fromTable:(NSString*)aTableName from:(NSDate*)startDate to:(NSDate*)endDate;

/*
 gets the newest weight from the database based on date selected by the user.
 */

+(Weight*)queryNewestWeight:(NSString*)aDBPath fromTable:(NSString*)aTableName;

/*
 insert a weight into a weight database
 */

+(void) insertWeightInDatabase:(NSString*)aDBPath weightToInsert:(Weight*)aWeight intoTable:(NSString*)aTableName;

/**
 Deletes an entry from database
 */
+(void) deleteWeightFromDatabase:(NSString*)aDBPath weightToDelete:(Weight*)aWeight fromTable:(NSString*)aTableName;

/**
 
 updates an entry by ID
 
 */

+(void)updateEntryFromDatabase:(NSString*)aDBPath weight:(Weight*)aWeight fromTable:(NSString*)aTableName;
	
@end
